home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp® 2.0.1 Tutorial / Chapter 09 / UIconEdit.p < prev   
Encoding:
Text File  |  1990-10-25  |  2.6 KB  |  101 lines  |  [TEXT/MPS ]

  1. {Copyright © 1989 by Apple Computer, Inc.  All rights reserved.}
  2.  
  3. UNIT UIconEdit;
  4.  
  5.  
  6. INTERFACE
  7.  
  8.  
  9. USES
  10.     { • MacApp }
  11.     UMacApp,
  12.     
  13.     { • Toolbox }
  14.     ToolUtils;
  15.     
  16.     
  17. CONST kSignature = 'ICED';
  18.       kFileType = 'IDOC'; 
  19.  
  20.  
  21. TYPE 
  22.     TIconApplication = OBJECT(TApplication)
  23.  
  24.         PROCEDURE TIconApplication.IIconApplication(iconFileType: OSType);
  25.             {Initializes the application and globals.}
  26.  
  27.         FUNCTION  TIconApplication.DoMakeDocument(itsCmdNumber: CmdNumber): TDocument; OVERRIDE;
  28.             { Creates a document of type TIconDocument and returns a reference to it.}
  29.  
  30.     END;
  31.  
  32.  
  33.     TIconDocument = OBJECT(TDocument)
  34.     
  35.         fIconBitMap:        TIconBitMap;        { The document’s icon object. }
  36.  
  37.  
  38.         PROCEDURE TIconDocument.IIconDocument;
  39.             { Initializes the document. }
  40.  
  41.         PROCEDURE TIconDocument.Free; OVERRIDE;
  42.             { Frees allocated memory when the document is closed. }
  43.  
  44.         PROCEDURE TIconDocument.DoInitialState; OVERRIDE;
  45.             { Sets the document's data to represent a "new" document. }
  46.  
  47.         PROCEDURE TIconDocument.DoMakeViews(forPrinting: boolean); OVERRIDE;
  48.             { Creates the windows to display the document's data. }
  49.  
  50.         PROCEDURE TIconDocument.Fields (PROCEDURE DoToField (fieldName: Str255;
  51.                                                                 fieldAddr: Ptr;
  52.                                                                 fieldType: INTEGER)); OVERRIDE;
  53.  
  54.     END;
  55.     
  56.     
  57.     TIconBitMap = OBJECT(TObject)
  58.  
  59.         fDataHandle:    Handle;                { Handle to the icon's bit map.            }
  60.  
  61.         PROCEDURE TIconBitMap.IIconBitMap;
  62.             { Initialize the IconBitMap object and allocate space for its data. }
  63.  
  64.         PROCEDURE TIconBitMap.Free; OVERRIDE;
  65.             { Free the icon's bit map. }
  66.             
  67.         PROCEDURE TIconBitMap.SetIconBitMap(theBitMap : Handle);
  68.             { Set the contents of the icon bit map to the new bit map. }
  69.             
  70.         PROCEDURE TIconBitMap.Clear;
  71.             { Clear the icon map by setting its bits to zero. }
  72.             
  73.         PROCEDURE TIconBitMap.Invert;
  74.             { Invert the icon's bit map. }
  75.             
  76.         PROCEDURE TIconBitMap.IconBitToWordBit (iconBit: Point; VAR word, bit: INTEGER);
  77.             { Convert icon bit numbers to the corresponding word and bit number. }
  78.             
  79.         FUNCTION TIconBitMap.GetBit(iconBit: Point): BOOLEAN;
  80.             { Return the state of the given bit. }
  81.             
  82.         PROCEDURE TIconBitMap.SetBit(iconBit: Point; turnBitOn: BOOLEAN);
  83.             { Set the state of the given bit as indicated. }
  84.  
  85.         FUNCTION TIconBitMap.Copy: TIconBitMap;
  86.             { Create a new icon object which is a copy of itself. }
  87.             
  88.         PROCEDURE TIconBitMap.CopyDataTo (anIcon: TIconBitMap);
  89.             { Copy icon data to an existing icon object. }
  90.             
  91.         PROCEDURE TIconBitMap.Fields (PROCEDURE DoToField (fieldName: Str255;
  92.                                                               fieldAddr: Ptr;
  93.                                                               fieldType: INTEGER)); OVERRIDE;
  94.     END;
  95.  
  96.  
  97. IMPLEMENTATION
  98.  
  99.     {$I UIconEdit.inc1.p}
  100.  
  101. END.